package com.itheima.duotai.test2;

public class Demo2 {
    public static void main(String[] args) {
        Person p = new SuperMan();
        p.eat();
        p.work();
        SuperMan s = (SuperMan) p;
        s.save();

    }
}
 class Person{
    public  void eat(){
        System.out.println("吃饭");
    }
    public void work(){
        System.out.println("上班");
    }
}
class SuperMan extends Person{
    public void save(){
        System.out.println("救人");
    }
}
